const path = require('path');

//拼接路径
function resolve(dir) {
    return path.join(__dirname, dir)
}

module.exports = {
    publicPath:process.env.NODE_ENV=='production'?'./':'/',
    productionSourceMap: true,
    chainWebpack: (config) => {
        config.resolve.alias
            .set('@', resolve('src'))
            if (process.env.NODE_ENV === 'production') {
            config.entry('app').clear().add('./src/main-prod.js')
            } else {
            config.entry('app').clear().add('./src/main-dev.js')
            }
        
           
    }
}